extends "../i_horse23_Hide/i_horse23_Hide.gd"
var flag2
func init():
    .init()
    name = "龙骦"
    resetdata()
    info = "冰焰钢甲：攻速减少33%，减伤增加10%；被攻击时，20%为敌人附加5 层<结霜>和5层<烧灼>，若敌方已存在<结霜>或<烧灼>则消耗所有层数，对敌人附加1层<冰冻>并造成(层数和 * 17) 点真伤[cd:7秒]\n" + info

func _connect():
    ._connect()
    masCha.connect("onHurt",self,"bygk")
    masCha.connect("onBattleStart",self,"resetflag2")

func resetflag2():
    flag2 = 1
    
func _upS():
    ._upS()
    if !flag2:
        cnt3 += 1
        if cnt3 == 7:
            cnt3 = 0
            flag2 = 1

func bygk(atkinfo):
    if atkinfo.isMiss || !flag2:return 
    if sys.rndPer(20):
        flag2 = 0
        var bf1 = atkinfo.atkCha.hasBuff("b_jieShuang")
        var bf2 = atkinfo.atkCha.hasBuff("b_shaoZhuo")
        if bf1 || bf2:
            var cnt = 0
            if bf1:
                bf1.isDel = true
                cnt += int(bf1.life + 0.5)
            if bf2:
                bf2.isDel = true
                cnt += int(bf2.life + 0.5)
            masCha.hurtChara(atkinfo.atkCha,cnt * 17,Chara.HurtType.REAL,Chara.AtkType.SKILL)
        atkinfo.atkCha.addBuff(b_jieShuang.new(5))
        atkinfo.atkCha.addBuff(b_shaoZhuo.new(5))